<% form_for(@category) do |f| %>
  <%= flash_and_form_errors(@category) %>
  <table class="form">
    <tr>
      <td class="name">Name*</td>
      <td class="value"><%= f.text_field(:name) %></td>
      <td class="details"></td>
    </tr>
    <tr>
      <td class="name">Parent</td>
      <td class="value">
        <%= f.select(:parent_id, Category.select_options(@category), :include_blank => "No parent") %>
      </td>
      <td class="details"></td>
    </tr>
  </table>
  <%= f.submit((@category.new_record? ? "Create" : "Update") + " Category") %>
<% end %>